<?php
/**
 * Delivery return
 */
class DeRt extends AppModel {
    var $name = 'DeRt';

    var $useTable = 'delivery_returns';

    var $belongsTo = array(
        'DeRtH' => array(
            'foreignKey' => 'delivery_return_head_id'
        ),
        'Product', 'CustProductSite'
    );

    var $validate = array(
        'return_qty' => array(
            'rule' => 'numeric',
            'message' => 'Please input return qty.',
            'on' => 'create',
            'required' => true
        ),
        'product_id' => array(
            'rule' => 'notEmpty',
            'message' => 'Please input product id.',
            'on' => 'create',
            'required' => true
        ),
        'cust_product_site_id' => array(
            'rule' => 'notEmpty',
            'message' => 'Please input cust product site.',
            'on' => 'create',
            'required' => true
        ),
        'price' => array(
            'rule' => 'numeric',
            'message' => 'Please input product price.',
            'on' => 'create'
        ),
    );
}
?>
